"use strict";
require([
  './dev/layer',
  'polyfill',
  './dev/nav',
  './dev/link',
  './dev/choices',
  'text!tpl/chatlist.hbs'
], function ( layer, polyfill, nav, Link, Choices, chat) {

  nav.showNav();

  //layer.loadLayer();

  layui.use('layer', () => { //独立版的layer无需执行这一句
    const $ = layui.jquery;
    $.getJSON("./data/chat.json", (data) => {
      const i = window.location.href.split("/").length - 1;
      const lastName = window.location.href.split("/")[i].split(".")[0];
      $.each(data, (index, item) => {
        if (item.id === lastName) {
          layer.setlayTpl('laytpl', item.id, chat, item)
        }
      });

    });



  });



  Choices.choList()





});

